<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>用户注册</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="bg-light d-flex justify-content-center align-items-center" style="height: 100vh;">

<div class="border bg-white p-5 rounded shadow" style="min-width: 320px;">
    <h2 class="text-center mb-4">📝 用户注册</h2>

    <form method="POST">
        <div class="mb-3">
            <label class="form-label">用户名</label>
            <input type="text" name="username" class="form-control" required>
        </div>

        <div class="mb-3">
            <label class="form-label">密码</label>
            <input type="password" name="password" class="form-control" required>
        </div>

        <div class="mb-3">
            <label class="form-label">角色</label>
            <select name="role" class="form-select">
                <option value="user">普通用户</option>
                <option value="farmer">养殖户</option>
                <option value="admin">管理员</option>
            </select>
        </div>

        <div class="d-grid gap-2">
            <input type="submit" class="btn btn-success" value="注册">
        </div>
    </form>

    <p class="mt-3 text-center">
        已有账号？
        <a href="{{ url_for('login') }}">点击登录</a>
    </p>
</div>

</body>
</html>
